using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Enemy_Skeleton : Enemy
{


    #region State
    public SkeletonIdleState idleState { get; private set; } 
    public SkeletonMoveState moveState  {get; private set; }
    public SkeletonBattleState battleState { get; private set; }

    public SkeletonAttackState attackState { get; private set; }
    public SkeletonWaitAttackCDState waitAttackCDState { get; private set; }

    public SkeletonStunnedState stunnedState { get; private set; }
    public SkeletonDeadState deadState { get; private set; }
#endregion
protected override void Awake()
    {
        base.Awake();
        idleState = new SkeletonIdleState(this, this, stateMachine, "Idle");
        moveState = new SkeletonMoveState(this, this, stateMachine, "Move");
        battleState = new SkeletonBattleState(this, this, stateMachine, "Move");
        attackState = new SkeletonAttackState(this, this, stateMachine, "Attack");
        waitAttackCDState = new SkeletonWaitAttackCDState(this, this, stateMachine, "Idle");
        stunnedState = new SkeletonStunnedState(this, this, stateMachine, "Stunned");
        deadState = new SkeletonDeadState(this, this, stateMachine, "Dead");
    }

    protected override void Start()
    {
        base.Start();
        stateMachine.Initialize(idleState);
    }

    protected override void Update()
    {
        base.Update();
    }

    public override void AnimationTrigger()
    {
        base.AnimationTrigger();
    }

    public override bool CanBeStunned(float knockedDir)
    {
        if (base.CanBeStunned(knockedDir))
        {
            stateMachine.ChangeState(stunnedState);
            return true;
        }
        return false;
    }

    public override void Die()
    {
        base.Die();
        stateMachine.ChangeState(deadState);
    }

}
